{template 'common/header'}
<ul class="nav nav-tabs">
	<li><a href="{php echo $this->createWebUrl('member')}&op=playhistory">游戏记录</a></li>
	<li><a href="{php echo $this->createWebUrl('member')}&op=membermanager">会员管理</a></li>
	<li class="active"><a href="{php echo $this->createWebUrl('qrmanager')}">游戏二维码</a></li>
</ul>   
<form action="" method="get">
<input type="hidden" name="c" value="site">
<input type="hidden" name="a" value="entry">
<input type="hidden" name="m" value="game_fish">
<input type="hidden" name="do" value="qrmanager">
<input type="hidden" name="op" value="selectqr">
<div class="panel panel-default"> 
    <div class="panel-body table-responsive"> 
                          <div class="form-group">
                                <div class="input-group">
                                    <span class="input-group-addon">二维码使用时间：</span>
                             
									 {php echo tpl_form_field_daterange("qrusetime",$qrusetime);}
                                </div>
                                
                           </div>
                          <div class="form-group">
                                <div class="input-group">
                                    <span class="input-group-addon">二维码使用者昵称：</span>
                             
									<input type="text" name="qrusenickname" value="{$qrusenickname}" class="form-control"/>
                                </div>
                                
                           </div>
                           
 						<input type="submit" class="btn btn-primary" value="搜索"/>
    </div>
</div>
</form>
<script>
function getLocalTime(nS) {  
	 return new Date(parseInt(nS) * 1000).toLocaleString().replace(/:\d{1,2}$/,' ');  
	}
</script>
<form action="{php echo $this->createWebUrl('qrmanager',array('op'=>'createqr'))}" method="post"> 
   <div class="panel panel-default"> 
    <div class="panel-body table-responsive"> 
     <table class="table table-hover text-center"> 
      <thead class="navbar-inner"> 
       <tr> 
        <th style="text-align:center">id</th> 
        <th style="text-align:center">二维码图片</th> 
       <!-- <th style="text-align:center">二维码链接路径</th>   -->
        <th style="text-align:center">二维码游戏码</th> 
        <th style="text-align:center">二维码使用时间</th>
        <th style="text-align:center">二维码使用者</th>
        <th style="text-align:center">状态</th>  
        <th style="text-align:center">操作</th> 
       </tr> 
      </thead> 
      <tbody> 
        
      {loop $list $index $item}
      	<tr>
        <td>{$item['id']}</td> 
        <input type="hidden" name="gameid" value="{$item['id']}"/>
        <td> <img src="{$item['gameqrimgurl']}" style="width:80px;height:80px;"/></td> 
		<!-- <td><p>{$item['qrurl']}</p></td> -->
        <td>{$item['gameqrnum']}</td> 
        <td>{if $item['usetime']}<script>document.write(getLocalTime("{$item['usetime']}"));</script>{/if}</td>
        <td>{$item['gameqrusername']}</td>
        <td>{if $item['status']==1} <span class="label label-success">已使用</span>{elseif $item['status']==0}<span class="label label-default">未使用</span>{elseif $item['status']==2}<span class="label label-default">已过期</span>{/if}</td> 
        <td>
        <a download="" href="{$item['gameqrimgurl']}" class="btn btn-default btn-sm" title="下载"><i class="glyphicon glyphicon-download-alt"></i></a>
         <a href="{php echo $this->createWebUrl('qrmanager',array('op'=>'delete','id'=>$item['id']))}" class="btn btn-default btn-sm" onclick="return confirm('确认删除此二维码?')" title="删除"><i class="glyphicon glyphicon-remove"></i></a> </td> 
       </tr>   
       {/loop}     
       <tr><td colspan="7" style="text-align:left;">二维码数量:<input type="text"  style="width:100px;height:33px;" name="createqrnum"/> <button class="btn btn-default" type="submit"><i class="glyphicon glyphicon-plus"></i> 添加游戏二维码</button><input type="hidden" name="token" value="bd06da03"></td></tr> 
      </tbody> 
     </table>
     <form action=""　method="get">
	    <input type="hidden" name="c" value="site">
		<input type="hidden" name="a" value="entry">
		<input type="hidden" name="m" value="game_fish">
		<input type="hidden" name="do" value="qrmanager">
     
     {$pager}
     </form> 
    </div> 
   </div> 
  </form>

{template 'common/footer'}